/**
 * 
 */
package furniture.items3d.model.tessellation;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.vecmath.Vector3d;

import furniture.render3d.Polygon3d;
import furniture.render3d.TriangleSet;


/**
 * @author Grill Balazs (balage.g@gmail.com)
 *
 */
public class ItemSet implements TriangleSet {

	private final List<TriangleSet> sets = new ArrayList<TriangleSet>();
	
	/**
	 * @see furniture.render3d.TriangleSet#getTriangles()
	 */
	public Collection<Polygon3d> getTriangles() {
		List<Polygon3d> list = new ArrayList<Polygon3d>();
		for(TriangleSet set : sets)
			list.addAll(set.getTriangles());
		return list;
	}

	public void addSet(TriangleSet set){
		sets.add(set);
	}

	public void translate(Vector3d vector) {
		for(TriangleSet set : sets) set.translate(vector);
	}
	
}
